<extend name="Public/base" />

<!-- 子导航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>

<block name="body">
<style>
.main-title h2{ padding:10px 0 10px 20px;}
.columns-mod .bd{ height:auto;}
.columns-mod .hd a{line-height:12px; width:auto; height:auto;}
</style>
	<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
	<div class="main-title cf">

		<h2>
			客户名称：{$genjin.[0].name}
		</h2>
 
	</ul>
	</div>
	<!-- 标签页导航 -->
<div class="tab-wrap">

	<div class="tab-content">
	<!-- 表单 -->
	<div class="container-span"> <div class="span2">
	<div class="columns-mod">
		<div class="hd cf">
			<h5>系统信息</h5>
			<div class="title-opt"><a href="#"></a>
			</div>
		</div>
		<div class="bd">
			<div class="sys-info">
				<table>
					<tbody><tr>
						<th>跟进状态</th>
						<td><switch name="genjin.[0].status">
    <case value="1">感兴趣</case>
    <case value="2">意向强烈</case>
      <case value="3">近期合作</case>
    <case value="4">成交</case>  
       <case value="5">半死不活</case>
    <case value="26">未成交</case>    
    
    <default />暂无数据
</switch>
													</td>
					</tr>
					<tr>
						<th>文件地址</th>
						<td><a href="{$genjin[0].file_id}">下载</a></td>
					</tr>
					<tr>
						<th>跟进时间</th>
						<td>{$genjin[0].follow_time|time_format}</td>
					</tr>
					<tr>
						<th>跟进内容:</th>
						<td> {$genjin[0].content}</td>
					</tr>
					
				</tbody></table>
			</div>
		</div>
	</div>
</div></div>
	</div>
</div>
</block>

<block name="script">
<link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
<php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
<link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript">

Think.setValue("type", {$data.type|default='""'});
Think.setValue("display", {$data.display|default=0});

$('#submit').click(function(){
	$('#form').submit();
});

$(function(){
    $('.date').datetimepicker({
        format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });
    $('.time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });
    showTab();

	<if condition="C('OPEN_DRAFTBOX') and (ACTION_NAME eq 'add' or $data['status'] eq 3)">
	//保存草稿
	var interval;
	$('#autoSave').click(function(){
        var target_form = $(this).attr('target-form');
        var target = $(this).attr('url')
        var form = $('.'+target_form);
        var query = form.serialize();
        var that = this;

        $(that).addClass('disabled').attr('autocomplete','off').prop('disabled',true);
        $.post(target,query).success(function(data){
            if (data.status==1) {
                updateAlert(data.info ,'alert-success');
                $('input[name=id]').val(data.data.id);
            }else{
                updateAlert(data.info);
            }
            setTimeout(function(){
                $('#top-alert').find('button').click();
                $(that).removeClass('disabled').prop('disabled',false);
            },1500);
        })

        //重新开始定时器
        clearInterval(interval);
        autoSaveDraft();
        return false;
    });

	//Ctrl+S保存草稿
	$('body').keydown(function(e){
		if(e.ctrlKey && e.which == 83){
			$('#autoSave').click();
			return false;
		}
	});

	//每隔一段时间保存草稿
	function autoSaveDraft(){
		interval = setInterval(function(){
			//只有基础信息填写了，才会触发
			var title = $('input[name=title]').val();
			var name = $('input[name=name]').val();
			var des = $('textarea[name=description]').val();
			if(title != '' || name != '' || des != ''){
				$('#autoSave').click();
			}
		}, 1000*parseInt({:C('DRAFT_AOTOSAVE_INTERVAL')}));
	}
	autoSaveDraft();

	</if>

});
</script>
</block>
